package idea.innovacion.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.ArrayList;

import idea.innovacion.bean.IdeaDTO;
import idea.innovacion.bean.IdeaDiscusionDTO;
import idea.innovacion.interfaces.IIdeaDiscusionDAO;
import idea.innovacion.util.ConexionDB;

public class MySqlIdeaDiscusionDAO implements IIdeaDiscusionDAO {

	@Override
	public boolean insertIdeaDiscusion(IdeaDiscusionDTO dto) throws SQLException {
		// TODO Auto-generated method stub
		boolean retorno;
		IdeaDTO objIdea = null;
		String sql = null;
		Connection conn = null;
		sql = "Insert IdeaDiscusion values (?,?,?)";
		
        conn = ConexionDB.GetConnection();
		
		PreparedStatement pstm = conn.prepareStatement(sql);
		pstm.setInt(1, dto.getIdIdeaDiscusion());
		pstm.setString(2, dto.getDescripcion());
		pstm.setInt(3, dto.getIdIdea());
		
		
		retorno = pstm.execute();
		
		return retorno;
		
	}
	

	@Override
	public ArrayList<IdeaDiscusionDTO> listIdeaDiscusion() throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}
	

}
